package util;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * VO实体state-》Value的转换工具类
 * Created by tanjing on 2019/2/13.
 */
public class StateToValueUtils {
    /**
     * 栏目模块转换
     * @param state
     * @return
     */
    public static String switchCmsCategoryModuleValue(String state){
        if(StringUtils.isBlank(state)){
            return "";
        }
        switch (state){
            case "1":
                return  "未实名";
            case "2":
                return  "审核中";
            case "3":
                return  "已实名";
            case "4":
                return  "驳回";
            default:
                return  "";
        }
    }

    /**
     * 图片添加前缀
     * @param image
     * @return
     */
    public static List realImageAddProfix(String image, String profix){
        ArrayList arrayList=new ArrayList();
        if(StringUtils.isBlank(image)){
            return arrayList;
        }
        String[] images=image.split(",");
        for (String str:images) {
            arrayList.add(profix+str);
        }
        return arrayList;
    }
}
